home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / encdec / encdec.frm < prev    next >
Text File  |  1999-10-06  |  6KB  |  230 lines

  1. VERSION 5.00
  2. Begin VB.Form encdec 
  3.    Caption         =   "Developed by Nikki - Encryption/decryption"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4980
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   4980
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command3 
  13.       Caption         =   "End"
  14.       Height          =   825
  15.       Left            =   2070
  16.       Picture         =   "encdec.frx":0000
  17.       Style           =   1  'Graphical
  18.       TabIndex        =   13
  19.       Top             =   2280
  20.       Width           =   945
  21.    End
  22.    Begin VB.CommandButton Command2 
  23.       Caption         =   "Decrypt value in Box 3."
  24.       Height          =   465
  25.       Left            =   3180
  26.       TabIndex        =   5
  27.       Top             =   2520
  28.       Width           =   1185
  29.    End
  30.    Begin VB.TextBox decr 
  31.       Height          =   285
  32.       Left            =   2880
  33.       TabIndex        =   4
  34.       Top             =   450
  35.       Width           =   1605
  36.    End
  37.    Begin VB.TextBox svd 
  38.       Height          =   465
  39.       Left            =   1110
  40.       TabIndex        =   2
  41.       Top             =   1620
  42.       Width           =   2535
  43.    End
  44.    Begin VB.CommandButton Command1 
  45.       Caption         =   "Encrypt value in Box 1."
  46.       Height          =   435
  47.       Left            =   330
  48.       TabIndex        =   1
  49.       Top             =   2550
  50.       Width           =   1425
  51.    End
  52.    Begin VB.TextBox pwd 
  53.       Height          =   315
  54.       Left            =   360
  55.       TabIndex        =   0
  56.       Top             =   480
  57.       Width           =   1665
  58.    End
  59.    Begin VB.Label Label6 
  60.       Caption         =   "3."
  61.       BeginProperty Font 
  62.          Name            =   "MS Sans Serif"
  63.          Size            =   8.25
  64.          Charset         =   0
  65.          Weight          =   700
  66.          Underline       =   0   'False
  67.          Italic          =   0   'False
  68.          Strikethrough   =   0   'False
  69.       EndProperty
  70.       Height          =   495
  71.       Left            =   450
  72.       TabIndex        =   12
  73.       Top             =   1650
  74.       Width           =   375
  75.    End
  76.    Begin VB.Label Label5 
  77.       Caption         =   "2."
  78.       BeginProperty Font 
  79.          Name            =   "MS Sans Serif"
  80.          Size            =   8.25
  81.          Charset         =   0
  82.          Weight          =   700
  83.          Underline       =   0   'False
  84.          Italic          =   0   'False
  85.          Strikethrough   =   0   'False
  86.       EndProperty
  87.       Height          =   405
  88.       Left            =   2490
  89.       TabIndex        =   11
  90.       Top             =   420
  91.       Width           =   315
  92.    End
  93.    Begin VB.Label Label4 
  94.       Caption         =   "1."
  95.       BeginProperty Font 
  96.          Name            =   "MS Sans Serif"
  97.          Size            =   8.25
  98.          Charset         =   0
  99.          Weight          =   700
  100.          Underline       =   0   'False
  101.          Italic          =   0   'False
  102.          Strikethrough   =   0   'False
  103.       EndProperty
  104.       Height          =   285
  105.       Left            =   30
  106.       TabIndex        =   10
  107.       Top             =   540
  108.       Width           =   285
  109.    End
  110.    Begin VB.Label Label3 
  111.       Caption         =   "Decrypting encrypted string"
  112.       Height          =   645
  113.       Left            =   3870
  114.       TabIndex        =   9
  115.       Top             =   1440
  116.       Width           =   885
  117.    End
  118.    Begin VB.Label Label2 
  119.       Caption         =   "Value obtained after performing algorithm"
  120.       Height          =   495
  121.       Left            =   150
  122.       TabIndex        =   8
  123.       Top             =   1140
  124.       Width           =   1845
  125.    End
  126.    Begin VB.Line Line3 
  127.       X1              =   4080
  128.       X2              =   4140
  129.       Y1              =   1050
  130.       Y2              =   1230
  131.    End
  132.    Begin VB.Line Line2 
  133.       X1              =   3900
  134.       X2              =   4050
  135.       Y1              =   1050
  136.       Y2              =   1020
  137.    End
  138.    Begin VB.Line Line1 
  139.       X1              =   3750
  140.       X2              =   4080
  141.       Y1              =   1620
  142.       Y2              =   990
  143.    End
  144.    Begin VB.Label b 
  145.       Height          =   285
  146.       Left            =   3150
  147.       TabIndex        =   7
  148.       Top             =   840
  149.       Width           =   945
  150.    End
  151.    Begin VB.Label a 
  152.       Height          =   315
  153.       Left            =   420
  154.       TabIndex        =   6
  155.       Top             =   900
  156.       Width           =   855
  157.    End
  158.    Begin VB.Label Label1 
  159.       Caption         =   "Enter a string to encrypted"
  160.       Height          =   195
  161.       Left            =   60
  162.       TabIndex        =   3
  163.       Top             =   150
  164.       Width           =   1935
  165.    End
  166. End
  167. Attribute VB_Name = "encdec"
  168. Attribute VB_GlobalNameSpace = False
  169. Attribute VB_Creatable = False
  170. Attribute VB_PredeclaredId = True
  171. Attribute VB_Exposed = False
  172. Private Sub Command1_Click()
  173. encrypwd
  174.  
  175. End Sub
  176.  
  177. Private Sub encrypwd()
  178. Dim ori As String
  179. Dim plen As Integer
  180. Dim i As Integer
  181. Dim tchg As String
  182. Dim fchg As String
  183. Dim asval As Integer
  184.  
  185. ori = pwd.Text
  186. plen = Len(ori)
  187. i = 1
  188. fchg = ""
  189.  
  190. While Not i > plen
  191.  
  192. tchg = Mid(ori, i, 1)
  193. asval = (Asc(tchg) + 4) * 2 - 4
  194. fchg = fchg + Chr(asval)
  195. i = i + 1
  196. Wend
  197. a.Caption = asval
  198. svd.Text = fchg
  199. End Sub
  200.  
  201.  
  202.  
  203. Private Sub decrypwd()
  204. Dim tchg As String
  205. Dim fchg As String
  206. Dim plen As Integer
  207. Dim i As Integer
  208. Dim asval As Integer
  209. i = 1
  210. plen = Len(svd.Text)
  211.  
  212. While Not i > plen
  213. tchg = Mid(svd.Text, i, 1)
  214. asval = (Asc(tchg) + 4) / 2 - 4
  215. fchg = fchg + Chr(asval)
  216. i = i + 1
  217. Wend
  218. b.Caption = asval
  219. decr.Text = fchg
  220.  
  221. End Sub
  222.  
  223. Private Sub Command2_Click()
  224. decrypwd
  225. End Sub
  226.  
  227. Private Sub Command3_Click()
  228. End
  229. End Sub
  230.